package com.rickpan.dto.request;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;

/**
 * 上传初始化请求DTO
 */
public class UploadInitRequest {
    
    @NotBlank(message = "文件名不能为空")
    private String fileName;
    
    @NotNull(message = "文件大小不能为空")
    @Positive(message = "文件大小必须大于0")
    private Long fileSize;
    
    @NotBlank(message = "文件SHA256不能为空")
    private String fileSha256;
    
    @NotNull(message = "分片大小不能为空")
    @Positive(message = "分片大小必须大于0")
    private Integer chunkSize;
    
    private Long parentId;
    
    private String mimeType;
    
    // 构造函数
    public UploadInitRequest() {}
    
    public UploadInitRequest(String fileName, Long fileSize, String fileSha256, Integer chunkSize) {
        this.fileName = fileName;
        this.fileSize = fileSize;
        this.fileSha256 = fileSha256;
        this.chunkSize = chunkSize;
    }
    
    // Getter和Setter方法
    public String getFileName() {
        return fileName;
    }
    
    public void setFileName(String fileName) {
        this.fileName = fileName;
    }
    
    public Long getFileSize() {
        return fileSize;
    }
    
    public void setFileSize(Long fileSize) {
        this.fileSize = fileSize;
    }
    
    public String getFileSha256() {
        return fileSha256;
    }
    
    public void setFileSha256(String fileSha256) {
        this.fileSha256 = fileSha256;
    }
    
    public Integer getChunkSize() {
        return chunkSize;
    }
    
    public void setChunkSize(Integer chunkSize) {
        this.chunkSize = chunkSize;
    }
    
    public Long getParentId() {
        return parentId;
    }
    
    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }
    
    public String getMimeType() {
        return mimeType;
    }
    
    public void setMimeType(String mimeType) {
        this.mimeType = mimeType;
    }
    
    @Override
    public String toString() {
        return "UploadInitRequest{" +
                "fileName='" + fileName + '\'' +
                ", fileSize=" + fileSize +
                ", fileSha256='" + fileSha256 + '\'' +
                ", chunkSize=" + chunkSize +
                ", parentId=" + parentId +
                ", mimeType='" + mimeType + '\'' +
                '}';
    }
}
